<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>通知列表</title>
</head>
<style>
    * { margin:0; padding:0;}
    .head{height: 50px;margin-top: 10px;margin-left: 4%;}
    .head span{color: #888;font-size: 14px;}
    .head select{width: 250px;height: 35px;border:1px solid #ddd;border-radius: 10px;}
</style>

<link rel="stylesheet" href="/css/notices.css">
<script src="/js/jquery.min.js"></script>
<body>
<div class="head">
        <span>通知分类：</span>
        <select id="notifycate">
                <option value="1" <%=results.msg_type==1?"selected":"" %> >放假通知</option>
                <option value="2" <%=results.msg_type==2?"selected":"" %> >日常通知</option>
                <option value="3" <%=results.msg_type==3?"selected":"" %> >紧急通知</option>
        </select>
    </div>
<ul class="notice-list">
	<% for(var i=0;i<results.result.length;i++){ %>
         <li>
            <input type="hidden" value="<%=results.result[i].Msg_Id %>" id="aaa">
            <a onclick="showdetail(this)">
                    <span class="title"><%=results.result[i].Msg_Title %></span>
                    <span class="status"><%=results.result[i].Status==0?"[未读]":"[已读]" %></span>
                    <span class="contents"><%=results.result[i].Msg_Content %></span>
                    <span class="date"><%=results.result[i].Time_Send.getFullYear()+"年"+results.result[i].Time_Send.getMonth()+"月"+results.result[i].Time_Send.getDate()+"日" %></span>
                </a>
         </li>
     <% } %>
</ul>
<script> 
    $(".notice-list li").click(function(){
        $(this).addClass("readed").children($(".readed .status").text("[已读]"))
    })

    function showdetail(e){
        var msg_id = e.parentNode.firstElementChild.value;
        window.location.href="/admin/notifydetail?msg_id="+msg_id;
    }

    $("#notifycate").change(function(){
        var num = $("#notifycate").val();
        window.location.href="/user/notifylist?msg_type="+num;
    });
</script>
</body>
</html>
